<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
  String path = request.getContextPath();
  String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="utf-8">
  <title>首页</title>
  <jsp:include page="../../../main/mp/resource.jsp"	/>
  <link href="../resource/core/plugins/jqGrid/5.1.1/css/ui.jqgrid-bootstrap.css" rel="stylesheet">
  <link href="../resource/core/css/nifty.min.css" rel="stylesheet">

  <style>
    #sendBack,#sendApprove,#sendDeny{
      width: 300px;
      position: absolute;
      top: 50%;
      left: 50%;
      margin: -150px 0 0 -150px;
    }
    #showFlow li,span{
      margin: 0!important;
    }
  </style>

</head>
<body>
<!-- 侧滑导航根容器 -->
<div class="mui-off-canvas-wrap">
  <!-- 菜单容器 -->
  <aside class="mui-off-canvas-left">
    <div class="mui-scroll-wrapper">
      <div class="mui-scroll">
        <!-- 菜单具体展示内容 -->

        <ul class="mui-table-view mui-table-view-chevron" id="navLeft">

          <li class="mui-table-view-cell">
            <a id="index2" class="mui-navigate-right" data-link="index2.jsp" >首页</a>
          </li>

          <li class="mui-table-view-cell mui-collapse">
            <a class="mui-navigate-right" href="#">财务管理</a>
            <ul class="mui-table-view mui-table-view-chevron">
              <li class="mui-table-view-cell">
                <a class="mui-navigate-right toLink" data-link="menu/com/expense?viewtype=2">费用报销</a>
              </li>

              <li class="mui-table-view-cell">
                <a class="mui-navigate-right toLink" data-link="menu/com/pay?viewtype=2">付款申请</a>
              </li>

              <li class="mui-table-view-cell">
                <a class="mui-navigate-right toLink" data-link="menu/com/loanApply?viewtype=2">借款申请</a>
              </li>
            </ul>
          </li>

          <li class="mui-table-view-cell mui-collapse">
            <a class="mui-navigate-right">CRM管理</a>
            <ul class="mui-table-view mui-table-view-chevron">
              <li class="mui-table-view-cell">
                <a class="mui-navigate-right toLink" data-link="menu/com/customerInfo?viewtype=2">顾客登记</a>
              </li>

              <li class="mui-table-view-cell">
                <a class="mui-navigate-right toLink" data-link="menu/com/businessTalk?viewtype=2">沟通拜访</a>
              </li>

              <li class="mui-table-view-cell">
                <a class="mui-navigate-right toLink" data-link="menu/com/businessChance?viewtype=2">机会登记</a>
              </li>

              <li class="mui-table-view-cell">
                <a class="mui-navigate-right toLink" data-link="menu/com/contractDeal?viewtype=2">合同评审</a>
              </li>

              <li class="mui-table-view-cell">
                <a class="mui-navigate-right toLink" data-link="menu/com/contractPerform?viewtype=2">开票收款</a>
              </li>
            </ul>
          </li>

          <li class="mui-table-view-cell">
            <a class="mui-navigate-right">行政管理</a>
          </li>

          <li class="mui-table-view-cell mui-collapse">
            <a class="mui-navigate-right">人事管理</a>
            <ul class="mui-table-view mui-table-view-chevron">
              <li class="mui-table-view-cell">
                <a class="mui-navigate-right toLink" data-link="menu/com/leave?viewtype=2">请假管理</a>
              </li>
            </ul>
          </li>

        </ul>

      </div>
    </div>
  </aside>
  <!-- 主页面容器 -->
  <div class="mui-inner-wrap">
    <!-- 主页面标题 -->
    <header class="mui-bar mui-bar-nav">
      <a class="mui-icon mui-action-menu mui-icon-bars mui-pull-left" id="nnav"></a>
      <h1 class="mui-title">标题</h1>
    </header>
    <div class="mui-content mui-scroll-wrapper" style="overflow: scroll">
      <div class="mui-scroll" id="page-content">
        <!-- 主界面具体展示内容 -->

        <div class="panel">
          <h4 class="panel_title">待办事宜</h4>
          <ul class="mui-table-view" id="toDoUl">
            <%--<li class="mui-table-view-cell">--%>
              <%--您的【报销申请】 FYBX201708291234 已被 王力宏 通过--%>
            <%--</li>--%>
            <%--<li class="mui-table-view-cell">--%>
              <%--您的【报销申请】 FYBX201708291234 已被 王力宏 通过--%>
            <%--</li>--%>
            <%--<li class="mui-table-view-cell">--%>
              <%--您的【报销申请】 FYBX201708291234 已被 王力宏 通过--%>
            <%--</li>--%>
            <%--<li class="mui-table-view-cell">--%>
              <%--您的【报销申请】 FYBX201708291234 已被 王力宏 通过--%>
            <%--</li>--%>
            <%--<li class="mui-table-view-cell">--%>
              <%--您的【报销申请】 FYBX201708291234 已被 王力宏 通过--%>
            <%--</li>--%>
          </ul>
        </div>

        <div class="panel">
          <h4 class="panel_title">常用审批</h4>
          <div id="model_mp_list" class="panel_content">

            <c:forEach var="item" items="${commonModelList}" varStatus="status">
              <div class="panel_left">
                <img src="<%=path%>/resource/core/mp/images/mid-banner/banner1.png" width="40px">
                <p>${item.val1}</p>
                <input type="hidden" name="commonId" value="${item.key1}">
              </div>
            </c:forEach>

            <%--<div class="panel_left">--%>
              <%--<img src="<%=path%>/resource/core/mp/images/mid-banner/banner2.png" width="40px">--%>
              <%--<p>人事信息</p>--%>
              <%--<input type="hidden" name="commonId" value="com.fz.us.oa.core.entity.com.PersonnelInfo">--%>
            <%--</div>--%>

            <%--<div class="panel_left">--%>
              <%--<img src="<%=path%>/resource/core/mp/images/mid-banner/banner3.png" width="40px">--%>
              <%--<p>任务管理</p>--%>
              <%--<input type="hidden" name="commonId" value="com.fz.us.oa.core.entity.com.Task">--%>
            <%--</div>--%>

            <%--<div class="panel_left">--%>
              <%--<img src="<%=path%>/resource/core/mp/images/mid-banner/banner4.png" width="40px">--%>
              <%--<p>资质管理</p>--%>
              <%--<input type="hidden" name="commonId" value="com.fz.us.oa.core.entity.com.Certificate">--%>
            <%--</div>--%>

            <%--<div class="panel_left">--%>
              <%--<img src="<%=path%>/resource/core/mp/images/mid-banner/banner5.png" width="40px">--%>
              <%--<p>资产调拨</p>--%>
              <%--<input type="hidden" name="commonId" value="com.fz.us.oa.core.entity.com.AssetFlit">--%>
            <%--</div>--%>

            <%--<div class="panel_left">--%>
              <%--<img src="<%=path%>/resource/core/mp/images/mid-banner/banner6.png" width="40px">--%>
              <%--<p>发文管理</p>--%>
              <%--<input type="hidden" name="commonId" value="com.fz.us.oa.core.entity.com.Dispatch">--%>
            <%--</div>--%>
            <div class="clear"></div>
          </div>
        </div>

        <div class="panel">
          <h4 class="panel_title">新闻公告</h4>
          <ul class="mui-table-view">
            <li class="mui-table-view-cell">
              您的【报销申请】 FYBX201708291234 已被 王力宏 通过
            </li>
            <li class="mui-table-view-cell">
              您的【报销申请】 FYBX201708291234 已被 王力宏 通过
            </li>
            <li class="mui-table-view-cell">
              您的【报销申请】 FYBX201708291234 已被 王力宏 通过
            </li>
            <li class="mui-table-view-cell">
              您的【报销申请】 FYBX201708291234 已被 王力宏 通过
            </li>
            <li class="mui-table-view-cell">
              您的【报销申请】 FYBX201708291234 已被 王力宏 通过
            </li>
          </ul>
        </div>


      </div>
    </div>
  </div>
</div>

</body>
</html>

<script src="../resource/core/js/nifty.js"></script>
<script src="../resource/core/plugins/jqGrid/5.1.1/js/jquery.jqGrid.min.js"></script>
<script src="../resource/core/plugins/jqGrid/5.1.1/js/i18n/grid.locale-cn.js"></script>
<script src="../resource/core/plugins/jquery-validation/1.15.0/jquery.validate.min.js"></script>
<script src="../resource/core/plugins/jquery-validation/1.15.0/i18n/messages_zh.min.js"></script>
<script>

//  //禁用手势侧滑
//  var offCanvasWrapper=document.getElementsByClassName("mui-off-canvas-wrap");
//  var offCanvasInner = offCanvasWrapper[0].querySelector('.mui-inner-wrap');
//  offCanvasInner.addEventListener('drag', function(event) {
//    event.stopPropagation();
//  });

  $(function(){

    //待办
    __ajax_get("../main/taskRecord/toDoList",null,function(data){
      var toDoList=data.dataRows;
      $("#toDoUl").empty();
      for(var i=0;i<toDoList.length;i++){
        var mpUrl="../mp"+toDoList[i].url.substring(6,toDoList[i].url.length);
        var newLi='<li class="mui-table-view-cell" onclick="loadURL(\''+mpUrl+'\', $(\'#page-content\'))">'+toDoList[i].pname+'</li>';
        $("#toDoUl").append(newLi);
      }
    });
  });

  var navOpen=document.getElementById("nnav");
  navOpen.addEventListener('tap',function () {
    mui('.mui-off-canvas-wrap').offCanvas().toggle();
  });

  mui("#navLeft").on('tap','.toLink',function(){
    var url=$(this).attr("data-link");
    loadURL(url, $('#page-content'));
    mui('.mui-off-canvas-wrap').offCanvas().close()
  });

  var index2=document.getElementById("index2");
  index2.addEventListener("tap",function(){
    location.reload();
  });

  $("#model_mp_list .panel_left").click(function(){
    var formKey = $(this).find("input").val();
    var entityName=formKey.substring(formKey.lastIndexOf(".")+1,formKey.length);
    var a=entityName.charAt(0).toLowerCase();
    entityName=a+entityName.substring(1,entityName.length);
    var url="<%=path%>/mp/"+entityName+"/input";
    mui.alert(url);
//    loadURL(url,$("#page-content"));
  });

</script>